from django.shortcuts import render
from django.http import *

# Create your views here.
from reportlab.pdfgen import canvas


def index(req):
    return HttpResponse("Hello Index")


def exportpdf(req):
    response = HttpResponse(content_type='application/pdf')
    response['Content-Disposition'] = 'attachment; filename="somefilename.pdf"'
    p = canvas.Canvas(response)
    p.drawString(100, 100, "Hello world.")
    p.showPage()
    p.save()
    return response
